import ddt
from testconfig import config

from framework.appium.appiumbasetest import AppiumBaseTest
from lib.mobile.mobiletasks import MobileTasks


@ddt.ddt()
class AndrAppBVTTest(AppiumBaseTest):
    _multiprocess_can_split_ = True

    def setUp(self):
        super().setUp(config=config)

    def tearDown(self):
        super().tearDown()

    @ddt.data('SamSung1', 'SamSung2')
    def test_bvt(self, device_name):
        self.init_driver_by_device_name(config, deviceName=device_name)
        self.mobile_tasks = MobileTasks(self.driver)

        ret = self.mobile_tasks.is_record_event_btn_exist()
        self.logger.info(f'RecordEven按钮元素可以在页面上被定位到 => {ret}')
        self.assertTrue(ret, 'RecordEven按钮元素无法被定位！！')
